package com.acme;

public class Test {
	public static void main(String[] args) {
		int v1 = 3;
		// byte v2 = v1;
		// Error: narrowing conversion
		byte v2 = (byte) v1;
		System.out.println(v2);
		v1 = 256;
		// byte v3 = v1;
		// Error: narrowing conversion
		// and out of range
		int v3 = v1;
		System.out.println(v3);
		int v4 = 's';
		System.out.println(v4);
		
		byte v5 = 115;
		if (v5 == 's') {
			System.out.println("Equals");
		}
		
		System.out.println((double)4);
		// Out: 4.0
		
		double d = 5;
		System.out.println(d + 1);
		// Out: 6.0
		
		// boolean b = v4;
		// Error: boolean variables can only 
		// take on values true and false
		boolean b = true;
		
		// short v6 = "short";
		// Error: short is an integer type, not a string
		String v6 = "short";
		
		// float v7 = 3.67;
		// Error: narrowing conversion
		// double is default
		float v7 = (float) 3.67;
		
		float v9 = 3;
		// No error: automatical widening conversion
		
		// int v8 = v7;
		// Error: types mismatch, narrowing conversion
		int v8 = (int) v7;
		
		// int array[] = new double["27"];
		// Error: types mismatch, narrowing conversion,
		// "27" must be a number, not a string
		int array[] = new int[27];
	}
}
